﻿<!DOCTYPE html>
<html>
<head>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/StyleSheet.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/JScriptCommon.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Res/jqueryui186custom/development-bundle/ui/minified/jquery.ui.position.min.js")"
        type="text/javascript"></script>
    <script src="@Url.Content("~/Res/jqueryui186custom/development-bundle/ui/minified/jquery.ui.core.min.js")"
        type="text/javascript"></script>
    <script src="@Url.Content("~/Res/jqueryui186custom/development-bundle/ui/minified/jquery.ui.widget.min.js")"
        type="text/javascript"></script>
    <script src="@Url.Content("~/Res/jqueryui186custom/development-bundle/ui/minified/jquery.ui.button.min.js")"
        type="text/javascript"></script>
    <script src="@Url.Content("~/Res/jqueryui186custom/development-bundle/ui/minified/jquery.ui.dialog.min.js")"
        type="text/javascript"></script>
    <link href="@Url.Content("~/Res/jqueryui186custom/css/ui-lightness/jquery-ui-1.8.6.custom.css")"
        rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    @RenderSection("header", false)
    <script type='text/javascript'>
        function ajaxFrom(form, url) {

            $.ajax({
                url: url,
                type: "Post",
                data: $(form).serialize(),
                dataType: "json",
                success: function (data) {

                    if (data != null && data == "修改失败") {
                        $('    <div id="dialo" title="操作提示">' + data + '</div>').dialog({
                            autoOpen: true,
                            modal: true,
                            buttons: {
                                "继续操作": function () {
                                    $(this).dialog("close");
                                },
                                "返回列表": function () {
                                    window.location.href = 'javascript:history.go(-1)';
                                }
                            }
                        });
                    } else {
                        $('    <div id="dialo" title="操作提示">' + data + '</div>').dialog({
                            autoOpen: true,
                            modal: true,
                            close: closeback,
                            buttons: {
                                "返回列表": function () {
                                    window.location.href = 'javascript:history.go(-1)';
                                }
                            }
                        });
                    }

                }
            });
        }
        function closeback(e, ui) {
            window.location.href = "../";
        }

        $(function () {
            $(":submit,:button").button();
            popTextArea($("textarea"));

            $("form").submit(function (form) {
                if (form.result) {
                    ajaxFrom(this, this.action);
                }
                return false;
            });
        });
    </script>
</head>
<body>
    <div class="mbx">
        @RenderSection("top", false)
    </div>
    @using (Html.BeginForm())
    { 
        @Html.ValidationSummary(true)
        @RenderBody()
    }
</body>
</html>
